<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>

<form id= "uploadForm">  
       Name: <input type="text" name="name"><br>
		Email: <input type="email" name="email"><br>
		Files: <input type="file" name="file"><br><br>
      <input type="button" value="上传" onclick="doUpload()" />  
</form>  
		
		<script>
		function doUpload() {  
			 var formData = new FormData($( "#uploadForm" )[0]);  
			 $.ajax({  
				  url: 'http://127.0.0.1:8080/api/v2/upload' ,  
				  type: 'POST',  
				  data: formData,  
				  async: false,  
				  cache: false,  
				  contentType: false,  
				  processData: false,  
				  success: function (returndata) {  
					  alert(returndata);  
				  },  
				  error: function (returndata) {  
					  alert(returndata);  
				  }  
			 });  
		}  
		</script>